/***************************************************************************
*   Copyright (C) 2006 by Yuri Ovcharenko                                 *
*   amwsoft@gmail.com                                                     *
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU General Public License as published by  *
*   the Free Software Foundation; either version 2 of the License, or     *
*   (at your option) any later version.                                   *
*                                                                         *
*   This program is distributed in the hope that it will be useful,       *
*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
*   GNU General Public License for more details.                          *
*                                                                         *
*   You should have received a copy of the GNU General Public License     *
*   along with this program; if not, write to the                         *
*   Free Software Foundation, Inc.,                                       *
*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
***************************************************************************/
#ifndef PLUGINMANAGER_H
#define PLUGINMANAGER_H

#include <QObject>

#include <QList>
#include <QStringList>

/**
 * @author Yuri Ovcharenko <amwsoft@gmail.com>
 */

class DCPlugin;

/**
 * @class PluginManager
 * PluginManager manages DC plugins.
 */
class PluginManager : public QObject
{
    Q_OBJECT
  public:
    PluginManager( QObject *parent = 0 );
    ~PluginManager();

  public:
    QStringList dirs();
    int count();
    DCPlugin *plugin(const QString & name) const;
    DCPlugin *plugin(int index) const;
    QString pluginName(int index) const;
    QWidget *pluginWidget(int index) const;
    void deactivatePlugin(int index);
    void searchPlugins(const QStringList & dirs = QStringList());
    void setSettingsDir(const QString & dir);
    void savePluginSettings(int index);
    void restorePluginSettings(int index);

    public slots:
      void slotPluginChanged();

  private:
    QStringList dirList;
    QList<DCPlugin *> plugins;
    QString PluginSettingsDir;
};

#endif
